<?php
/**
 * Created by PhpStorm.
 * User: liuhong
 * Date: 2019-04-08
 * Time: 17:32
 */

namespace app\service;


use app\model\SourceModel;
use think\Exception;

/**
 * 资源文件
 * Class SourceService
 * @package app\service
 */
class SourceService extends BaseService
{
    public $sourceModel;
    public function __construct()
    {
        $this->sourceModel=new SourceModel();
    }


    /**
     * @param array $where
     * @param $filed
     * @return array|bool
     */
    public function selectSource($where=array(),$filed=null){
        try{
             return $this->sourceModel
                 ->field($filed)
                 ->where($where)
                 ->order("ord","desc")
                 ->select()
                 ->toArray();
        }catch (Exception $ex){
            LogService::S()->writeLog('Exception',$ex->getMessage());
            return false;
        }
    }

}